import { IPSDEDRDetail } from './ipsdedrdetail';
import { IPSDEOPPriv } from '../priv/ipsdeoppriv';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysImage } from '../../res/ipssys-image';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEDRDetailImpl extends PSModelObjectImpl implements IPSDEDRDetail {
  protected cappslanguageres: IPSLanguageRes | null = null;

  getCapPSLanguageRes(): IPSLanguageRes | null {
    if (this.cappslanguageres != null) return this.cappslanguageres;
    const value = this.M.getCapPSLanguageRes;
    if (value == null) {
      return null;
    }
    this.cappslanguageres = this.getPSModel4('res.IPSLanguageRes', value, 'getCapPSLanguageRes') as IPSLanguageRes;
    return this.cappslanguageres;
  }

  get capPSLanguageRes(): IPSLanguageRes | null {
    return this.getCapPSLanguageRes();
  }

  getCapPSLanguageResMust(): IPSLanguageRes {
    const value = this.getCapPSLanguageRes();
    if (value == null) {
      throw new Error('未指定标题语言资源');
    }
    return value;
  }

  get caption(): string {
    return this.M.caption;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get counterId(): string {
    return this.M.counterId;
  }

  get detailType(): 'DRITEM' | 'PDTVIEW' {
    return this.M.detailType;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get enableMode(): 'ALL' | 'INWF' | 'ALLWF' | 'EDIT' | 'DEOPPRIV' | 'CUSTOM' {
    return this.M.enableMode;
  }

  get memo(): string {
    return this.M.memo;
  }

  get name(): string {
    return this.M.name;
  }

  get orderValue(): number {
    return this.M.orderValue;
  }

  get originCaption(): string {
    return this.M.originCaption;
  }

  get psDETreeId(): string {
    return this.M.getPSDETreeId;
  }

  getPSDETreeId(): string {
    return this.M.getPSDETreeId;
  }

  protected pssysimage: IPSSysImage | null = null;

  getPSSysImage(): IPSSysImage | null {
    if (this.pssysimage != null) return this.pssysimage;
    const value = this.M.getPSSysImage;
    if (value == null) {
      return null;
    }
    this.pssysimage = this.getPSModel4('res.IPSSysImage', value, 'getPSSysImage') as IPSSysImage;
    return this.pssysimage;
  }

  get psSysImage(): IPSSysImage | null {
    return this.getPSSysImage();
  }

  getPSSysImageMust(): IPSSysImage {
    const value = this.getPSSysImage();
    if (value == null) {
      throw new Error('未指定成员图标资源对象');
    }
    return value;
  }

  protected testpsdeoppriv: IPSDEOPPriv | null = null;

  getTestPSDEOPPriv(): IPSDEOPPriv | null {
    if (this.testpsdeoppriv != null) return this.testpsdeoppriv;
    const value = this.M.getTestPSDEOPPriv;
    if (value == null) {
      return null;
    }
    this.testpsdeoppriv = this.getPSModel4('dataentity.priv.IPSDEOPPriv', value, 'getTestPSDEOPPriv') as IPSDEOPPriv;
    return this.testpsdeoppriv;
  }

  get testPSDEOPPriv(): IPSDEOPPriv | null {
    return this.getTestPSDEOPPriv();
  }

  getTestPSDEOPPrivMust(): IPSDEOPPriv {
    const value = this.getTestPSDEOPPriv();
    if (value == null) {
      throw new Error('未指定判断输出实体操作标识');
    }
    return value;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get cls(): string {
    return 'PSDEDRDetailImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'dataentity.dr.IPSDEDRDetail') return true;
    return super.instanceof(cls);
  }
}
